using System;
using System.Text;
using System.Collections.Generic;
using iBeauty.BusinessObjects;
using iBeauty.DAL;

namespace iBeauty.BLL
{
	public class ServiceBLL
	{
		private ServiceDAO _ServiceDAO;

		public ServiceDAO ServiceDAO
		{
			get { return _ServiceDAO; }
			set { _ServiceDAO = value; }
		}

		public ServiceBLL()
		{
			ServiceDAO = new ServiceDAO();
		}
		public List<Service> GetServices()
		{
			try
			{
				return ServiceDAO.GetServices();
			}
			catch(Exception ex)
			{
				throw ex;
			}
		}
		public Service GetService(string ID)
		{
			try
			{
				return ServiceDAO.GetService(ID);
			}
			catch(Exception ex)
			{
				throw ex;
			}
		}
		public int AddService(Service oService)
		{
			try
			{
				return ServiceDAO.AddService(oService);
			}
			catch (Exception ex)
			{
				throw ex;
			}
		}
		public int AddService(string ID,DateTime? CreateDate,DateTime? ModifiedDate,DateTime? TimeStamp,string ServiceCode,string ServiceName,Single? Price,Single? ForeignPrice,string Currency,string Barcode,int? AccountId,string Note)
		{
			try
			{
				return ServiceDAO.AddService(ID,CreateDate,ModifiedDate,TimeStamp,ServiceCode,ServiceName,Price,ForeignPrice,Currency,Barcode,AccountId,Note);
			}
			catch (Exception ex)
			{
				throw ex;
			}
		}
		public int UpdateService(Service oService)
		{
			try
			{
				return ServiceDAO.UpdateService(oService);
			}
			catch (Exception ex)
			{
				throw ex;
			}
		}
		public int UpdateService(string ID,DateTime? CreateDate,DateTime? ModifiedDate,DateTime? TimeStamp,string ServiceCode,string ServiceName,Single? Price,Single? ForeignPrice,string Currency,string Barcode,int? AccountId,string Note)
		{
			try
			{
				return ServiceDAO.UpdateService(ID,CreateDate,ModifiedDate,TimeStamp,ServiceCode,ServiceName,Price,ForeignPrice,Currency,Barcode,AccountId,Note);
			}
			catch (Exception ex)
			{
				throw ex;
			}
		}
		public int RemoveService(Service oService)
		{
			try
			{
				return ServiceDAO.RemoveService(oService);
			}
			catch (Exception ex)
			{
				throw ex;
			}
		}
		public int RemoveService(string ID)
		{
			try
			{
				return ServiceDAO.RemoveService(ID);
			}
			catch (Exception ex)
			{
				throw ex;
			}
		}
		public List<Service> DeserializeServices(string Path)
		{
			try
			{
				return GenericXmlSerializer<List<Service>>.Deserialize(Path);
			}
			catch (Exception ex)
			{
				throw ex;
			}
		}
		public void SerializeServices(string Path, List<Service> Services)
		{
			try
			{
				GenericXmlSerializer<List<Service>>.Serialize(Services, Path);
			}
			catch (Exception ex)
			{
				throw ex;
			}
		}
	}
}
